在windows下使用shell,运行shell脚本 |
您所在的位置:网站首页 › shell命令 -s › 在windows下使用shell,运行shell脚本 |
在Windows操作系统下运行Shell脚本,缺少的只是一个Git软件。其下载路径为Git - Downloading Package。 安装之后,将安装路径下的bin文件夹的路径作为环境变量。于是我们就能够在CMD中通过 sh xxx.sh来运行Shell脚本。 参考:https://zhuanlan.zhihu.com/p/59451678
PS:windows,Git安装路径下的bin文件夹:
PS:3楼评论的小伙伴(谢谢^_^),给出了全路径下调用sh.exe 去运行sh脚本的方案,即: 命令:c:\Program Files\Git\bin\sh.exe E:\devops\oss_backup.sh 和 进入shell命令行,如下进入:C:\Program Files\Git\bin>bash.exe Administrator@iZighe9m8ihy8vZ MINGW64 /bin$ cp
我自己尝试了一下,如下图: 1、windows+R,调出cmd 2、进入shell命令行
3、退出sh命令行,又回到cmd界面
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |